require(["config"], function(config) {
	require(["jQuery", "startM", "ajax", "cook","page"], function(jq,startM, ajax, cook,page) {
		$(function(){
			ajax.get("2.json",function(str){
				var obj=JSON.parse(str);
				var arr=obj.listShow;
				//页数
				var num=Math.ceil((arr.length)/10);
				for (var j=0;j<num;j++) {
					var col=[];
					col="col"+j;
					for (var i in arr) {
						col=arr.slice((10*j),((j+1)*10));
					}
				var neiRong=$("<div></div>");
				var ul=$("<ul></ul>");
				for (var d in col) {
					var li=$("<li><a href='xiangQin.html?id="+col[d].pic_id+"'><img src='imgs/images/"+col[d].pic_img+"' ></a><p title='"+col[d].discription+"'>"+col[d].content+"</p><p><s>"+col[d].price+"</s><span>"+col[d].show_price+"</span></p></li>");
					ul.append(li);
				}
				neiRong.append(ul);
				$("#hiddenresult").append(neiRong);
				
				}
				
				 
				 var pagerBox = document.getElementById('pager');
				 var pager = new Pager({
				  index: 1,
				  total: num,
				  parent: pagerBox,
				  onchange: pageselectCallback
				 });
				 function pageselectCallback(page_index, jq){
					page_index=parseInt($(".js-selected").html())-1;
					var new_content=$("#hiddenresult>div:eq("+page_index+")").clone();
					$("#Searchresult").empty().append(new_content);
					return false;
				}
			});
		});
	});
});